<?php $this->load->view('navmenu');?>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
	var level1=0;
	var level2=0;
	var level3=0;
	function tambah_file() {
	    level1++;
	    var addin='<p><input type="file" class="uniform-file" name="userfile[]" /></p>';
	    
	    $('#file').append(addin);
	}
	
	function hapus_level1(id) {
	    $(id).remove();
	}
	
	function tambah_item() {
	    var addin='<tr><td><input type="text" name="no_pay_item[]" class="input-small"/></td><td><input type="text" name="volume[]" id="nama" class="input-small"/></td><td><input type="text" name="station_awal[]" class="input-small"/></td><td><input type="text" name="station_akhir[]" class="input-small"/></td><td><input type="text" name="tanggal_mulai[]" class="input-small"/></td><td><input type="text" name="jam_mulai[]" class="input-small"/></td><td><input type="text" name="tanggal_selesai[]" class="input-small"/></td><td><input type="text" name="jam_selesai[]" class="input-small"/></td></tr>';
	    
	    $('#item').append(addin);
	}
	
	function hapus_level2(id) {
	    $(id).remove();
	}
</script>

<div class="maincontent">
        	<div class="contentinner">
                
				<h4 class="widgettitle ctitle">Laporan Harian </h4>		
				<div class="widgetcontent bordered shadowed nopadding">
                    <form class="stdform stdform2" method="post" action="<?php echo base_url()?>index.php/laporan_harian/saveLaporanHarian" enctype="multipart/form-data">
							<p>
                                <label>Bidang Pekerjaan</label>
                                <span class="field"><select name="kode" id="selection2" class="uniformselect">
								<?php foreach($jenisPekerjaan as $jp):?>
								<option value="<?php echo $jp['kode'];?>"><?php echo $jp['kode'];?> / <?php echo $jp['uraian'];?></option>
								<?php endforeach; ?>
                                </select></span>
                            </p>
							 <p>
                                <label>Cuaca</label>
                                <span class="field"><select name="cuaca" id="selection2" class="uniformselect">
                                    <option value="Cerah">Cerah</option>
                                    <option value="Gerimis">Gerimis</option>
                                    <option value="Hujan">Hujan</option>
                                </select></span>
                            </p>
							<p>
                                <label>Tanggal Laporan</label>
                                <span class="field"><input type="text" name="tanggal" id="nama" value="<?php echo date('d-m-Y');?>" class="input-xlarge" readonly/></span>
                            </p>
							<p>
                            <label>File Laporan</label>
                            <span class="field" id="file">
                            	<input type="file" class="uniform-file" name="userfile" />
                            </span>
							</p>
                            <table border=1 class="table table-bordered" id="item">
							<tr>
								<th>Kode Pembayaran</th>
								<th>Volume</th>
								<th>Station Awal</th>
								<th>Station Akhir</th>
								<th>Tanggal Mulai</th>
								<th>Jam Mulai</th>
								<th>Tanggal Selesai</th>
								<th>Jam Selesai</th>
							</tr>
							<tr>
								<td>
									 <input type="text" name="no_pay_item[]" class="input-small"/>
								</td>
								<td><input type="text" name="volume[]" id="nama" class="input-small"/></td>
								<td><input type="text" name="station_awal[]" class="input-small"/></td>
								<td><input type="text" name="station_akhir[]" class="input-small"/></td>
								<td><input type="text" name="tanggal_mulai[]" class="input-small"/></td>
								<td><input type="text" name="jam_mulai[]" class="input-small"/></td>
								<td><input type="text" name="tanggal_selesai[]" class="input-small"/></td>
								<td><input type="text" name="jam_selesai[]" class="input-small"/></td>
							</tr>
							</table>                        
                            <p class="stdformbutton">
							<!--	<button type="button" onclick="tambah_file()" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Tambah File</button> -->
								<button type="button" onclick="tambah_item()" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Tambah Item</button>
								<button type="submit" name="submit" class="btn btn-primary">Submit Request Of Work</button>
								<button type="reset" name="reset" class="btn">Reset</button>
                            </p>
                        </form>
                    </div><!--widgetcontent-->		
            </div><!--contentinner-->
        </div><!--maincontent-->